package com.ruoyi.interviews.controller;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.interviews.service.impl.TencentMeetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@RestController
@RequestMapping("/api/meeting")
public class TencentMeetingController {
    @Autowired
    private TencentMeetingService meetingService;

    @PostMapping("/create")
    public JSONObject createMeeting(@RequestBody Map<String, Object> params) {
        String topic = (String) params.get("topic");
        String startTime = (String) params.get("startTime");
        int duration = (Integer) params.get("duration");
        String hostEmail = (String) params.get("hostEmail");
        return meetingService.createMeeting(topic, startTime, duration, hostEmail);
    }
}
